import request from '@/utils/request'
import { downloadAction } from '@/api/requestEvents'

//获得项目开题设计分页
export function topicOpenPage(params: any) {
  return request({
    url: '/project/topic-opening/page',
    method: 'get',
    params,
  })
}

//创建项目开题设计/同时自动发起初审
export function topicOpenCreate(data: any) {
  return request({
    url: '/project/topic-opening/create',
    method: 'post',
    data,
  })
}

//获得项目开题设计详情
export function topicOpenGet(params: any) {
  return request({
    url: '/project/topic-opening/get',
    method: 'get',
    params,
  })
}

//更新项目开题设计
export function topicOpenUpdate(data: any) {
  return request({
    url: '/project/topic-opening/update',
    method: 'put',
    data,
  })
}

//导出项目开题设计 Excel
export function topicOpenExport(params: any) {
  downloadAction(
    '/project/topic-opening/export-excel',
    'get',
    params,
    '开题设计报告列表.xls'
  )
}
